/*
 * @Author: Wanko
 * @Date: 2024-04-04 18:36:23
 * @LastEditors: Wanko
 * @LastEditTime: 2024-06-24 18:43:57
 * @Description:
 */
const { FILR_URL } = require('../config')
const { response } = require('../utils/Response')

class HomeCtl {
  async index(ctx) {
    ctx.body = '<h1>Card</h1>'
  }
  async upload(ctx) {
    const file = ctx.request.files.file
    const { newFilename } = file
    const url = `${FILR_URL}/${newFilename}`
    response(ctx, url)
  }
}
module.exports = new HomeCtl()
